package com.atomos.strategy.action
{
	import com.atomos.strategy.action.AbstractAction;
	import com.bourre.transitions.AbstractTween;
	import com.atomos.particle.Particle;

	public class AbstractLifeTweenAction extends AbstractAction
	{
		protected var _fEasing : Function;
		protected var _nStartValue : Number;
		protected var _nEndValue : Number;
		
		public function AbstractLifeTweenAction ( startValue : Number, endValue : Number, easing : Function = null )
		{
			_nStartValue = startValue;
			_nEndValue = endValue;
			_fEasing = ( easing != null ) ? easing : AbstractTween.noEasing;
		}
		
		override public function process( particle : Particle ) : void
		{
			var n : Number = _fEasing( particle.life, _nStartValue, _nEndValue - _nStartValue, particle.maxLife );
			_update( particle, n );
		}
		
		protected function _update ( particle : Particle, value : Number ) : void
		{
			
		}
	}
}